package ckw.database;

import java.io.Serializable;

public class NonresidentVoter implements Serializable {

	private static final long serialVersionUID = -2410465621739558331L;

	private Long id;
	private int voterStatus = 0;
	private Voter voter;
	private Election election;
	private String okwIdentificationField;

	public NonresidentVoter() {
	}

	public NonresidentVoter(Voter voter, Election election) {
		super();
		this.voter = voter;
		addToElection(election);
	}

	public Long getId() {
		return id;
	}

	@SuppressWarnings("unused")
	private void setId(Long id) {
		this.id = id;
	}

	public int getVoterStatus() {
		return voterStatus;
	}

	public void setVoterStatus(int voterStatus) {
		this.voterStatus = voterStatus;
	}

	public Voter getVoter() {
		return voter;
	}

	public void setVoter(Voter voter) {
		this.voter = voter;
	}

	public Election getElection() {
		return election;
	}

	public void setElection(Election election) {
		this.election = election;
	}

	public void addToElection(Election election) {
		this.setElection(election);
		election.getNonresidentVoters().add(this);
	}

	public void removeFromElection(Election election) {
		this.setElection(null);
		election.getNonresidentVoters().remove(this);
	}

	public String getOkwIdentificationField() {
		return okwIdentificationField;
	}

	public void setOkwIdentificationField(String okwIdentificationField) {
		this.okwIdentificationField = okwIdentificationField;
	}
}
